using System;
using System.Data;
using System.Collections.Generic;
using Soccer.Core;
using Soccer.Utility;

namespace Soccer.Business
{
    [TableAttribute("PlayerClubHistories")]
	[Serializable]
    public class PlayerClubHistory : DBO<PlayerClubHistory>
    {
		#region Fields
		
		private int? _IdPlayerClubHistory;
		private int? _IdPlayer;
		private int? _IdClub;
		private DateTime? _StartDate;
		private DateTime? _EndDate;
		private string _Salary;
		private int? _NumberClothe;
		private string _Position;
		
		#endregion
		
		#region Constructors
		/// <summary>
		/// Default constructor
		/// </summary>
		public PlayerClubHistory()
		{
			
		}
		
		/// <summary>
		/// Constructor with IdPlayerClubHistory 
		/// </summary>
		/// <param name="IdPlayerClubHistory">The IdPlayerClubHistory</param>
		public PlayerClubHistory(int? IdPlayerClubHistory )
		{
			this.IdPlayerClubHistory = IdPlayerClubHistory;
		}
		
		/// <summary>
		/// Constructor with all parameters
		/// </summary>
		/// <param name="IdPlayerClubHistory">Sets int? value for IdPlayerClubHistory</param>
		/// <param name="IdPlayer">Sets int? value for IdPlayer</param>
		/// <param name="IdClub">Sets int? value for IdClub</param>
		/// <param name="StartDate">Sets DateTime? value for StartDate</param>
		/// <param name="EndDate">Sets DateTime? value for EndDate</param>
		/// <param name="Salary">Sets string value for Salary</param>
		/// <param name="NumberClothe">Sets int? value for NumberClothe</param>
		/// <param name="Position">Sets string value for Position</param>
		public PlayerClubHistory(int? idPlayerClubHistory, int? idPlayer, int? idClub, DateTime? startDate, DateTime? endDate, string salary, int? numberClothe, string position)
		{
			this.IdPlayerClubHistory = idPlayerClubHistory;
			this.IdPlayer = idPlayer;
			this.IdClub = idClub;
			this.StartDate = startDate;
			this.EndDate = endDate;
			this.Salary = salary;
			this.NumberClothe = numberClothe;
			this.Position = position;
		}
		
		#endregion
		
		#region Properties
		
		/// <summary>
		/// Gets or sets int? value for IdPlayerClubHistory
		/// </summary>
		[ColumnAttribute("IdPlayerClubHistory", SqlDbType.Int , 4 , true, true, false)]
		public int? IdPlayerClubHistory
		{
			set
			{
				this._IdPlayerClubHistory = value;
			}
			get
			{
				return this._IdPlayerClubHistory;
			}
		}
		
		/// <summary>
		/// Gets or sets int? value for IdPlayer
		/// </summary>
		[ColumnAttribute("IdPlayer", SqlDbType.Int , 4 , false, false, true)]
		public int? IdPlayer
		{
			set
			{
				this._IdPlayer = value;
			}
			get
			{
				return this._IdPlayer;
			}
		}
		
		/// <summary>
		/// Gets or sets int? value for IdClub
		/// </summary>
		[ColumnAttribute("IdClub", SqlDbType.Int , 4 , false, false, true)]
		public int? IdClub
		{
			set
			{
				this._IdClub = value;
			}
			get
			{
				return this._IdClub;
			}
		}
		
		/// <summary>
		/// Gets or sets DateTime? value for StartDate
		/// </summary>
		[ColumnAttribute("StartDate", SqlDbType.DateTime , 8 , false, false, true)]
		public DateTime? StartDate
		{
			set
			{
				this._StartDate = value;
			}
			get
			{
				return this._StartDate;
			}
		}
		
		/// <summary>
		/// Gets or sets DateTime? value for EndDate
		/// </summary>
		[ColumnAttribute("EndDate", SqlDbType.DateTime , 8 , false, false, true)]
		public DateTime? EndDate
		{
			set
			{
				this._EndDate = value;
			}
			get
			{
				return this._EndDate;
			}
		}
		
		/// <summary>
		/// Gets or sets string value for Salary
		/// </summary>
		[ColumnAttribute("Salary", SqlDbType.NVarChar , 100 , false, false, true)]
		public string Salary
		{
			set
			{
				this._Salary = value;
			}
			get
			{
				return this._Salary;
			}
		}
		
		/// <summary>
		/// Gets or sets int? value for NumberClothe
		/// </summary>
		[ColumnAttribute("NumberClothe", SqlDbType.Int , 4 , false, false, true)]
		public int? NumberClothe
		{
			set
			{
				this._NumberClothe = value;
			}
			get
			{
				return this._NumberClothe;
			}
		}
		
		/// <summary>
		/// Gets or sets string value for Position
		/// </summary>
		[ColumnAttribute("Position", SqlDbType.NVarChar , 100 , false, false, true)]
		public string Position
		{
			set
			{
				this._Position = value;
			}
			get
			{
				return this._Position;
			}
		}
		
		
		/// <summary>
		/// Get a Club of current PlayerClubHistory object base on IdClub
		/// </summary>
		public Club Club
		{
			get
			{
				if (this.IdClub == null)
					return null;
	
				Club condition = new Club(this.IdClub);
				return ClubController.FindItem(condition);
			}
		}
		
		/// <summary>
		/// Get a Player of current PlayerClubHistory object base on IdPlayer
		/// </summary>
		public Player Player
		{
			get
			{
				if (this.IdPlayer == null)
					return null;
	
				Player condition = new Player(this.IdPlayer);
				return PlayerController.FindItem(condition);
			}
		}
		
		#endregion
        
        #region Other Properties
        private static ColumnNameStruct? _ColumnName;
        public static ColumnNameStruct ColumnName
        {
            get
            {
                if (!_ColumnName.HasValue)
                    _ColumnName = new ColumnNameStruct();
                return _ColumnName.Value;
            }
        }
        #endregion

        #region NestedType
        public  struct ColumnNameStruct
        {
            /// <summary>
            /// Get the name of column [IdPlayerClubHistory]
            /// </summary>
            public string IdPlayerClubHistory
            {
                get
                {
                    return "IdPlayerClubHistory";
                }
            }
            /// <summary>
            /// Get the name of column [IdPlayer]
            /// </summary>
            public string IdPlayer
            {
                get
                {
                    return "IdPlayer";
                }
            }
            /// <summary>
            /// Get the name of column [IdClub]
            /// </summary>
            public string IdClub
            {
                get
                {
                    return "IdClub";
                }
            }
            /// <summary>
            /// Get the name of column [StartDate]
            /// </summary>
            public string StartDate
            {
                get
                {
                    return "StartDate";
                }
            }
            /// <summary>
            /// Get the name of column [EndDate]
            /// </summary>
            public string EndDate
            {
                get
                {
                    return "EndDate";
                }
            }
            /// <summary>
            /// Get the name of column [Salary]
            /// </summary>
            public string Salary
            {
                get
                {
                    return "Salary";
                }
            }
            /// <summary>
            /// Get the name of column [NumberClothe]
            /// </summary>
            public string NumberClothe
            {
                get
                {
                    return "NumberClothe";
                }
            }
            /// <summary>
            /// Get the name of column [Position]
            /// </summary>
            public string Position
            {
                get
                {
                    return "Position";
                }
            }
        }
        #endregion
    }
}
